{% extends 'index.html' %}
{% load static %}

{% block content %}
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12">
                <div class="d-flex flex-wrap align-items-center justify-content-between mb-4">
                    <div>
                        <h4 class="mb-3">收藏题库</h4>
                        <p class="mb-0">
                            可以让您轻松地可视化所有收藏题目状态
                            <br>
                            您可以在此处查看、删除等操作
                        </p>
                    </div>
                </div>
            </div>
            <div class="col-lg-12">
                <div class="table-responsive rounded mb-3">
                    <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">
                        <table class="table mb-0 tbl-server-info dataTable no-footer" id="DataTables_Table_0"
                               role="grid" aria-describedby="DataTables_Table_0_info">
                            <thead class="bg-white text-uppercase">
                                <tr class="ligth ligth-data" role="row">
                                <th tabindex="0" rowspan="1"
                                    colspan="1"
                                    style="width: 500px;">题干
                                </th>
                                <th tabindex="0" rowspan="1"
                                    colspan="1"
                                    style="width: 300px;">发布时间
                                </th>
                                <th tabindex="0" rowspan="1"
                                    colspan="1"
                                    style="width: 50px;">正确率
                                </th>
                                <th tabindex="0" rowspan="1"
                                    colspan="1"
                                    style="width: 50px;">错误率
                                </th>
                                <th tabindex="0" rowspan="1"
                                    colspan="1"
                                    style="width: 50px;">正确次数
                                </th>
                                <th tabindex="0" rowspan="1"
                                    colspan="1"
                                    style="width: 100px;">总次数
                                </th>
                                <th tabindex="0" rowspan="1"
                                    colspan="1"
                                    style="width: 300px;">操作
                                </th>
                            </tr>
                            </thead>
                            <tbody class="ligth-body">
                                {% for exercise in exercise_list %}
                                    <tr role="row" class="odd">
                                        <td>{{ exercise.question }}</td>
                                        <td>{{ exercise.pub_time }}</td>
                                        <td>80%</td>
                                        <td>20%</td>
                                        <td>{{ exercise.correct_count }}</td>
                                        <td>{{ exercise.total_count }}</td>
                                        <td>
                                            <div class="d-flex align-items-center list-action">
                                                <a class="badge badge-info mr-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="查看" href="{% url 'exercise:detail' %}?id={{ exercise.id }}">
                                                    <i class="ri-eye-line mr-0"></i>
                                                </a>
                                                <a class="badge bg-success mr-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="做题" href="{% url 'exercise:do_exercise' %}?id={{ exercise.id }}&operate=detail">
                                                    <i class="ri-pencil-line mr-0"></i>
                                                </a>
                                                <a class="badge bg-warning mr-2" data-toggle="tooltip" data-placement="top" title="" data-original-title="取消收藏" href="{% url 'exercise:cancel_collection' %}?id={{ exercise.id }}">
                                                    <i class="ri-delete-bin-line mr-0"></i>
                                                </a>
                                            </div>
                                        </td>
                                    </tr>
                                {% endfor %}
                            </tbody>
                        </table>
                        <div class="dataTables_info" id="DataTables_Table_0_info" role="status" aria-live="polite">
                            共{{ exercise_list.count }}题
                        </div>
                        <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
                            <a class="paginate_button previous disabled" aria-controls="DataTables_Table_0"
                                data-dt-idx="0" tabindex="0" id="DataTables_Table_0_previous">
                                上一页
                            </a>
                            <span>
                                <a class="paginate_button current" aria-controls="DataTables_Table_0" data-dt-idx="1"
                                tabindex="0">1
                                </a>
                            </span>
                            <a class="paginate_button next disabled" aria-controls="DataTables_Table_0" data-dt-idx="2"
                                                            tabindex="0" id="DataTables_Table_0_next">
                                下一页
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}